<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../base.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<script type="text/javascript" src="${ctx }/js/datepicker/WdatePicker.js"></script>
</head>
<script type="text/javascript" src="${ctx}/resources/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
/* $(function() {
	 $("#dept").bind("change",function(){
		 $("#userInfo_manager_id").empty();
		 $.ajax({  
	            url:"userAction_showManager",  
	            type:'POST',  
	            data:"id="+$(this).val(),  
	            dataType:"text",  
	            success:function (data) {  
	            	if(data != ""){
	            		var msg = eval("(" + data + ")");
	            		$("#userInfo_manager_id").append("<option value=''>--请选择--</option>");
	            		for(var o in data) {
		            		$("#userInfo_manager_id").append("<option value='"+msg[o].id+"'>"+msg[o].name+"</option>");
		            	}
	            	}else{
	            		$("#userInfo_manager_id").append("<option value=''>当前部门没有领导可选</option>");
	            	}
	            }  
	        }) 
	});
	 
	
}); */
	/* function changeManager() {
		var deptId = $("#dept>option:selected");
		$.post("${ctx}/sysadmin/userAction_changeManager",{"deptId":deptId.val()},function(msg) {
			$("#userManager")[0].length = 1;
			$(msg).each(function() {
				$("#userManager").append("<option value='"+this.id+"'>"+ this.userName +"</option>");
			});
		});
	} */
	 function changeManager() {
		var deptId = $("#dept>option:selected");
		$.post("${ctx}/sysadmin/userAction_changeManager",{"deptId":deptId.val()},function(msg) {
			$("#userManager")[0].length = 1;
			$(msg).each(function() {
				$("#userManager").append("<option value='"+this.id+"'>"+ this.userName +"</option>");
			});
		});
	}
</script>
<body>
<form name="icform" method="post">

<div id="menubar">
<div id="middleMenubar">
<div id="innerMenubar">
  <div id="navMenubar">
<ul>
<li id="save"><a href="#" onclick="formSubmit('userAction_insert?cwhich=user','_self');this.blur();">保存</a></li>
<li id="back"><a href="#" onclick="history.go(-1);">返回</a></li>
</ul>
  </div>
</div>
</div>
</div>
   
<div class="textbox" id="centerTextbox">
  <div class="textbox-header">
  <div class="textbox-inner-header">
  <div class="textbox-title">
   新增用户
  </div> 
  </div>
  </div>
  

 
    <div>
		<table class="commonTable" cellspacing="1">
       		<tr>
	            <td class="columnTitle">所在部门：</td>
	            <td class="tableContent">
	            	 <s:select name="dept.id" list="#deptList" id="dept" onchange="changeManager()"
	            		listKey="id" listValue="deptName"
	            		headerKey="" headerValue="--请选择--"
	            	></s:select> 
	            </td>
	        </tr>
        	<tr>
	            <td class="columnTitle">登录名：</td>
	            <td class="tableContent"><input type="text" name="userName" value=""/></td>           
	             <td class="columnTitle">状态：</td>
	            <td class="tableContentAuto">
	            	<input type="radio" name="state" value="1" checked class="input"/>启用
	            	<input type="radio" name="state" value="0" class="input"/>停用
	            </td>
	        </tr>
        	<tr>
	            <td class="columnTitle">姓名：</td>
	            <td class="tableContent"><input type="text" name="userInfo.name" value=""/></td>
	            <td class="columnTitle">直属领导：</td>
	            <td class="tableContent">
	            	<%-- <s:select name="userInfo.manager.id" list="#userList"
	            		listKey="id" listValue="userInfo.name"
	            		headerKey="" headerValue="--请选择--"
	            	></s:select> --%>
	            	<select name="userInfo.manager.id" id="userManager">
	            		<option value="">--请选择--</option>
	            	</select>
	            </td>
	        </tr>		
	        <tr>
	        	<td class="columnTittle">邮箱：</td>
	        	<td class="tableContent">
	        		<input name="email" type="text" value=""/>
	        	</td>
	            <td class="columnTitle">入职时间：</td>
	            <td class="tableContent">
					<input type="text" style="width:90px;" name="userInfo.joinDate"
	            	 value=""
	             	onclick="WdatePicker({el:this,isShowOthers:true,dateFmt:'yyyy-MM-dd'});"/>
				</td>
				<td class="columnTitle">薪水：</td>
	            <td class="tableContent"><input type="text" name="userInfo.salary" value=""/></td>
	        </tr>		
	        <tr>
	            <td class="columnTitle">等级：</td>
	            <td class="tableContentAuto">
	            	<input type="radio" name="userInfo.degree" value="0" class="input"/>超级管理员
	            	<input type="radio" name="userInfo.degree" value="1" class="input"/>跨部门跨人员
	            	<input type="radio" name="userInfo.degree" value="2" class="input"/>管理所有下属部门和人员
	            	<input type="radio" name="userInfo.degree" value="3" class="input"/>管理本部门
	            	<input type="radio" name="userInfo.degree" value="4" class="input"/>普通员工
	            </td>
				<td class="columnTitle">性别：</td>
	            <td class="tableContentAuto">
	            	<input type="radio" name="userInfo.gender" value="1" class="input"/>男
	            	<input type="radio" name="userInfo.gender" value="0" class="input"/>女
	            </td>
	        </tr>	
        	<tr>
	            <td class="columnTitle">岗位：</td>
	            <td class="tableContent"><input type="text" name="userInfo.station" value=""/></td>
	            <td class="columnTitle">电话：</td>
	            <td class="tableContent"><input type="text" name="userInfo.telephone" value=""/></td>
	        </tr>	
        	<tr>
        	 
	            <td class="columnTitle">出生年月：</td>
	            <td class="tableContent">
					<input type="text" style="width:90px;" name="userInfo.birthday"
	            	 value=""
	             	onclick="WdatePicker({el:this,isShowOthers:true,dateFmt:'yyyy-MM-dd'});"/>
				</td>
	        </tr>	
        	<tr>
        	    <td class="columnTitle">排序号：</td>
	            <td class="tableContent"><input type="text" name="userInfo.orderNo" value=""/></td>
	            <td class="columnTitle">说明：</td>
	            <td class="tableContent">
	            	<textarea name="userInfo.remark" style="height:120px;"></textarea>
	            </td>
	        </tr>	
		</table>
	</div>
 
 
</form>
</body>
</html>

